-- WechatAgent
-- Created by chengb Dec/8/2015
-- 负责微信相关逻辑

module("WechatAgent", package.seeall);

-- 内部函数声明
local onWechatShareSucc;

-- 初始化
function init()
    -- 注册微信分享成功回调
    SdkMgr.registerOCCallback("onWechatShareSucc", onWechatShareSucc);
end

-- 微信分享成功的回调
function onWechatShareSucc(shareType)
    shareType = tonumber(shareType);

    trace("WechatAgent", "微信分享成功，类型：%d", shareType);

    -- 抛出分享成功的事件
    EventMgr.fire(event.WECHAT_SHARE_SUCC, { ["shareType"] = shareType, });
end


